package com.atguigu.day03;

import java.util.Scanner;

public class Test6 {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        System.out.print("请输入a:");
        double a = s.nextDouble();
        System.out.print("请输入b:");
        double b = s.nextDouble();
        System.out.print("请输入c:");
        double c = s.nextDouble();
        double delta = (Math.sqrt(b * b - 4 * a * c));
        if (a != 0) {
            if (delta < 0) {
                System.out.println("无解");
            } else if (delta == 0) {
                System.out.println((-b) / (2 * a));
            } else
                System.out.println((-b + delta) / (2 * a) + " " + (-b - delta) / (2 * a));
        } else if (a == 0 && b != 0) {
            System.out.println(-c / b);
        }


    }
}
